# from sklearn.neural_network import MLPClassifier
import numpy as np
# X = [[0., 0.], [5., 2.],[2., 1.],[1., 1.]]
# y = [0, 1,3,5]
# clf = MLPClassifier(solver='lbfgs', alpha=1e-5,hidden_layer_sizes=(5, 2), random_state=1)
# clf.fit(X, y)
# print(np.array(X))
# print(np.array(X).shape)
# print(np.array(y))
# print(np.array(y).shape)
import matplotlib.pyplot as plt
x = np.arange(3,6,1); y = np.arange(1,4,1)

#对x,y网格化，得到X,Y
X,Y = np.meshgrid(x,y)
def f(X,Y):
    print(X)
    print(Y)
    print(np.sqrt(X**2+Y**2))
    return(np.sqrt(X**2+Y**2))

Z = f(X, Y)
fig, ax = plt.subplots(figsize=(8,8),dpi=100)
CS = ax.contourf(X, Y, Z)
# 画轮廓线
CS = ax.contour(X, Y, Z)

ax.set_xlabel('$x$'); ax.set_ylabel('$y$')
#设置x,y轴刻度
plt.xticks(np.arange(1,8,1))
plt.yticks(np.arange(1,8,1))
# 避免图片显示不完全
plt.tight_layout()
plt.show()